package com.sysmanage.permissions.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/** 
  * @ClassName: Company 
  * @Description: 公司实体类
  * @author XXXX@163.com
  * @date 2011-9-26 上午10:02:29 
  *  
  */
@Entity
@Table(name = "C_COMPANY")
public class Company implements Serializable {
	private java.lang.Integer id;

	private java.lang.String companyName;

	private java.lang.Integer parentId;

	private java.lang.String phone;
	

	
	private java.lang.String manager;

	private java.lang.String managerPhone;

	private java.lang.String contactPerson;

	private java.lang.String contactPhone;

	private java.lang.Integer areaId;

	private java.lang.String address;

	private java.lang.Double latitude;

	private java.lang.Double longitude;

	private java.lang.Integer companyType;

	private java.lang.String companyDescription;

	private java.lang.String companyImagePaht;
	
	private java.lang.String ext1;
	private java.lang.String ext2;
	private java.lang.String ext3;
	private java.lang.String ext4;
	private java.lang.Integer status;
	

	private java.lang.String weiXinNumber;
	
	private java.lang.String token;
	private java.lang.String appID;
	private java.lang.String appsecret;
	private java.lang.String accessToken;
	private java.util.Date atValidTime;
	//columns END


	public Company(){
	}

	public Company(java.lang.Integer companyId	){
		this.id = companyId;
	}

	

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	@Id 
	@GeneratedValue(strategy=GenerationType.AUTO)	
	@Column(name = "COMPANY_ID", unique = true, nullable = false)
	public java.lang.Integer getId() {
		return this.id;
	}
	
	@Column(name = "COMPANY_NAME", nullable = false, length = 200)
	public java.lang.String getCompanyName() {
		return this.companyName;
	}
	
	public void setCompanyName(java.lang.String value) {
		this.companyName = value;
	}
	
	@Column(name = "PARENT_ID", nullable = true)
	public java.lang.Integer getParentId() {
		return this.parentId;
	}
	
	public void setParentId(java.lang.Integer value) {
		this.parentId = value;
	}
	
	@Column(name = "PHONE", nullable = true, length = 50)
	public java.lang.String getPhone() {
		return this.phone;
	}
	
	public void setPhone(java.lang.String value) {
		this.phone = value;
	}
	@Column(name = "SERVER_WEIXIN_NUMBER", nullable = true, length = 50)
	public java.lang.String getWeiXinNumber() {
		return this.weiXinNumber;
	}
	
	public void setWeiXinNumber(java.lang.String value) {
		this.weiXinNumber = value;
	}
	
	@Column(name = "MANAGER", nullable = true, length = 20)
	public java.lang.String getManager() {
		return this.manager;
	}
	
	public void setManager(java.lang.String value) {
		this.manager = value;
	}
	
	@Column(name = "MANAGER_PHONE", nullable = true, length = 50)
	public java.lang.String getManagerPhone() {
		return this.managerPhone;
	}
	
	public void setManagerPhone(java.lang.String value) {
		this.managerPhone = value;
	}
	
	@Column(name = "CONTACT_PERSON", nullable = true, length = 20)
	public java.lang.String getContactPerson() {
		return this.contactPerson;
	}
	
	public void setContactPerson(java.lang.String value) {
		this.contactPerson = value;
	}
	
	@Column(name = "CONTACT_PHONE", nullable = true, length = 50)
	public java.lang.String getContactPhone() {
		return this.contactPhone;
	}
	
	public void setContactPhone(java.lang.String value) {
		this.contactPhone = value;
	}
	
	@Column(name = "AREA_ID", nullable = true, length = 10)
	public java.lang.Integer getAreaId() {
		return this.areaId;
	}
	
	public void setAreaId(java.lang.Integer value) {
		this.areaId = value;
	}
	
	@Column(name = "ADDRESS", nullable = true, length = 100)
	public java.lang.String getAddress() {
		return this.address;
	}
	
	public void setAddress(java.lang.String value) {
		this.address = value;
	}
	
	@Column(name = "LATITUDE", nullable = true, length = 53)
	public java.lang.Double getLatitude() {
		return this.latitude;
	}
	
	public void setLatitude(java.lang.Double value) {
		this.latitude = value;
	}
	
	@Column(name = "LONGITUDE", nullable = true, length = 53)
	public java.lang.Double getLongitude() {
		return this.longitude;
	}
	
	public void setLongitude(java.lang.Double value) {
		this.longitude = value;
	}
	
	@Column(name = "COMPANY_TYPE")
	public java.lang.Integer getCompanyType() {
		return this.companyType;
	}
	
	public void setCompanyType(java.lang.Integer value) {
		this.companyType = value;
	}
	
	@Column(name = "COMPANY_DESCRIPTION", nullable = true, length = 500)
	public java.lang.String getCompanyDescription() {
		return this.companyDescription;
	}
	
	public void setCompanyDescription(java.lang.String value) {
		this.companyDescription = value;
	}
	
	@Column(name = "COMPANY_IMAGE_PAHT", nullable = true, length = 250)
	public java.lang.String getCompanyImagePaht() {
		return this.companyImagePaht;
	}
	
	public void setCompanyImagePaht(java.lang.String value) {
		this.companyImagePaht = value;
	}
	@Column(name="ext1",length=200)
	public String getExt1() {
		return ext1;
	}
	@Column(name="ext2",length=200)
	public String getExt2() {
		return ext2;
	}
	@Column(name="ext3",length=200)
	public String getExt3() {
		return ext3;
	}
	@Column(name="ext4",length=200)
	public String getExt4() {
		return ext4;
	}
	@Column(name="status")
	public Integer getStatus() {
		return status;
	}
	
	
	
	public void setExt1(java.lang.String ext1) {
		this.ext1 = ext1;
	}

	public void setExt2(java.lang.String ext2) {
		this.ext2 = ext2;
	}

	public void setExt3(java.lang.String ext3) {
		this.ext3 = ext3;
	}

	public void setExt4(java.lang.String ext4) {
		this.ext4 = ext4;
	}

	public void setStatus(java.lang.Integer status) {
		this.status = status;
	}


	@Column(name="Token",length=200)
	public java.lang.String getToken() {
		return token;
	}

	public void setToken(java.lang.String token) {
		this.token = token;
	}
	@Column(name="appID",length=200)
	public java.lang.String getAppID() {
		return appID;
	}

	public void setAppID(java.lang.String appID) {
		this.appID = appID;
	}
	@Column(name="appsecret",length=200)
	public java.lang.String getAppsecret() {
		return appsecret;
	}

	public void setAppsecret(java.lang.String appsecret) {
		this.appsecret = appsecret;
	}


	@Column(name="ACCESS_TOKEN",length=200)
	public java.lang.String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(java.lang.String accessToken) {
		this.accessToken = accessToken;
	}
	@Column(name = "AT_VALID_TIME", nullable = true, length = 23)
	public java.util.Date getAtValidTime() {
		return atValidTime;
	}

	public void setAtValidTime(java.util.Date atValidTime) {
		this.atValidTime = atValidTime;
	}



	private Company company;
	public void setCompany(Company company){
		this.company = company;
	}
	
	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumns({
		@JoinColumn(name = "PARENT_ID",nullable = true, insertable = false, updatable = false) 
	})
	public Company getCompany() {
		return company;
	}
	public String toString() {
		return "公司[id:"+this.getId()+",name:"+this.getCompanyName()+"]";
	}
}
